package com.huawei.appmarket.service.store.awk.card;

import android.content.Context;
import android.view.View;
import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import com.huawei.appgallery.foundation.card.base.card.BaseDistCard;
import com.huawei.appgallery.foundation.ui.framework.cardframe.bean.BaseCardBean;
import com.huawei.appgallery.foundation.ui.framework.cardkit.bean.CardBean;
import o.azc;
import o.cgz;
import o.chy;
import o.eqx;
import o.eqx.d;
import o.evf;
import o.evx;
import o.ewm.j;

public class SmallLanternCard extends BaseDistCard {
    private ImageView ˋ;

    public SmallLanternCard(Context context) {
        super(context);
    }

    public cgz ˏ(View view) {
        this.ˋ = (ImageView) view.findViewById(j.ߴˋ);
        FrameLayout frameLayout = (FrameLayout) view.findViewById(j.ٴᐝ);
        if (evf.ˊ(view)) {
            frameLayout.setVisibility(4);
        } else {
            frameLayout.setVisibility(0);
        }
        ॱ((TextView) view.findViewById(j.ۥॱ));
        ʽ(view);
        return this;
    }

    public void ˏ(CardBean cardBean) {
        BaseCardBean baseCardBean = (BaseCardBean) cardBean;
        if (ˊ(baseCardBean)) {
            View ˉ = ˉ();
            LinearLayout linearLayout = (LinearLayout) ˉ.getParent();
            if (linearLayout != null) {
                linearLayout.removeView(ˉ);
                return;
            }
            return;
        }
        super.ˏ(cardBean);
        eqx.ˊ(this.ˋ, baseCardBean.ॱˌ(), "circle_default_icon", d.ˋ);
    }

    public void ॱ(final chy o_chy) {
        ˉ().setOnClickListener(new evx(this) {
            final /* synthetic */ SmallLanternCard ˏ;

            public void ˋ(View view) {
                o_chy.ˏ(0, this.ˏ);
            }
        });
    }

    private boolean ˊ(BaseCardBean baseCardBean) {
        String[] split = baseCardBean.ॱॱ().split("\\|");
        if (split.length > 1) {
            if ("com.huawei.gameassistant".equals(split[1])) {
                if (azc.ˎ().ॱ() < 20) {
                    return true;
                }
                return false;
            }
        }
        return false;
    }
}
